{include file="public/header" /}
<body style="">
<header id="header" class="mui-bar mui-bar-nav">
    <div class="mui-pull-left PopupNavigation">
        <img src="/static/home/bl_1.png" alt="">
    </div>
    <h1 class="mui-title">{:lang('注册会员')}</h1>
    <div class="mui-pull-right" style="display: none;">
        <div class="mui-switch mui-active" data-switch="2">
            <div class="mui-switch-handle"></div>
        </div>
    </div>
</header>

{include file="public/menu" /}

<div id="pullrefresh" class="mui-content mui-scroll-wrapper" data-scroll="1">
    <div class="mui-scroll" style="transform: translate3d(0px, 0px, 0px) translateZ(0px); transition-duration: 0ms;">
        <div class="gistememBox">
            <form id="regForm">
                <div class="gistememinput df">
                    <div class="gistememinputtl">{:lang('用户名')}:</div>
                    <div class="fx1">
                        <input type="text" name="username" autocomplete="off" class="gisteinput username" placeholder="{:lang('请输入手机号码')}">
                    </div>
                </div>
                
                <div class="gistememinput df">
                    <div class="gistememinputtl">{:lang('短信验证码')}:</div>
                    <div class="fx1">
                        <input type="text" name="code" style="width: 100px;" autocomplete="off" class="gisteinput" placeholder="{:lang('请输入验证码')}">
                        <button class="sms" type="button">{:lang('获取验证码')}</button>
                    </div>
                </div>
                <div class="gistememinput df" style="display: none;">
                    <div class="gistememinputtl">{:lang('姓名')}:</div>
                    <div class="fx1">
                        <input type="text" name="nickname" autocomplete="off" class="gisteinput" placeholder="{:lang('请输入姓名')}">
                    </div>
                </div>

                <div class="gistememinput df" style="display: none;">
                    <div class="gistememinputtl">{:lang('手机号码')}:</div>
                    <div class="fx1">
                        <input type="hidden" name="mobile" autocomplete="off" class="gisteinput" placeholder="{:lang('请输入手机号码')}">
                    </div>
                </div>

                <div class="gistememinput df">
                    <div class="gistememinputtl">{:lang('推荐人')}:</div>
                    <div class="fx1">
                        <input type="text" name="tjrAccount" disabled="" value="{$user['username']}" autocomplete="off" class="gisteinput" placeholder="{:lang('请输入推荐人账号')}">
                    </div>
                </div>
                <div class="gistememtshi">
                    {:lang('注册号默认密码为')} ：123456          
                                
                </div>
                <div class="applicaageAnbox">
                    <input type="hidden" name="tjrAccount" value="13927791603@qq.com">
                    <button class="applicaageAn regSub" type="button">{:lang('注册')}</button>
                </div>
            {:token('__hash__')}
            </form>
        </div>
    </div>
{include file="public/footer" /}
<script src="/static/home/echarts.min.js" type="text/javascript" charset="utf-8"></script>
<script>
    mui('.mui-scroll-wrapper').scroll({
        deceleration: 0.0005
    });
    var mask=mui.createMask(),isSub = true;
    mui('body').on('tap', '.regSub', function() {
        var obj = $(this);
        if(isSub) {
            isSub = false;
            var data = $('#regForm').serialize();
            var url = "{:url('addUser')}";
            mui.showLoading("注册中","div");
            mask.show();//显示遮罩层
            $.post(url, data, function(data) {
                mask.close();//关闭遮罩层
                mui.hideLoading();
                console.log(data.status);
                if(data.status == 0) {
                    isSub = true;
                    mui.toast(data.msg, {
                        duration: 'long',
                        type: 'div'
                    });
                } else if(data.status == 1) {
                    mui.toast(data.msg, {
                        duration: '2000',
                        type: 'div'
                    });
                    setTimeout(function() {
                        window.location.href = data.url;
                    }, 2000);
                }
            });
        }
    });
    $(".sms").click(function(){
        let phone = $(".username").val();
        $.post("{:url('base/sendSms')}",{action:'add',phone:phone},function(data){
            mui.toast(data.msg, {
                duration: '2000',
                type: 'div'
            });
        });
    });
</script>

</body></html>